package za.ac.cput.arrowgame.service.requesthandler;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import za.ac.cput.arrowgame.app.facade.Facade;

@Component
public class HandlerSetup {
    
    private static Logger logger = LoggerFactory.getLogger(HandlerSetup.class);

    public Handler createHandler() {
        logger.debug("creating handler Chain of Responsibility");
        HandleMove handlerMove = (HandleMove) Facade.getInstance().getHandleMove();
        HandleTurn handlerTurn = (HandleTurn) Facade.getInstance().getHandleTurn();
        handlerTurn.setSuccessorHandler(handlerMove);
        return handlerTurn;
    }
}
